Optimal. Leaf size=57 \[ -\frac {i B c x}{a}+\frac {B c \log (\cos (e+f x))}{a f}-\frac {(A+i B) c}{a f (i-\tan (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 57, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 39, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.051, Rules used = {3669, 45}
\begin {gather*} -\frac {c (A+i B)}{a f (-\tan (e+f x)+i)}+\frac {B c \log (\cos (e+f x))}{a f}-\frac {i B c x}{a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 45
Rule 3669
Rubi steps
\begin {align*} \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))}{a+i a \tan (e+f x)} \, dx &=\frac {(a c) \text {Subst}\left (\int \frac {A+B x}{(a+i a x)^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \text {Subst}\left (\int \left (\frac {-A-i B}{a^2 (-i+x)^2}-\frac {B}{a^2 (-i+x)}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {i B c x}{a}+\frac {B c \log (\cos (e+f x))}{a f}-\frac {(A+i B) c}{a f (i-\tan (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(124\) vs. \(2(57)=114\).
time = 0.67, size = 124, normalized size = 2.18 \begin {gather*} \frac {c \cos (e+f x) (A+B \tan (e+f x)) \left (A+i B-i B \log \left (\cos ^2(e+f x)\right )+\left (-i A+B+B \log \left (\cos ^2(e+f x)\right )\right ) \tan (e+f x)-2 i B \text {ArcTan}(\tan (f x)) (-i+\tan (e+f x))\right )}{2 a f (A \cos (e+f x)+B \sin (e+f x)) (-i+\tan (e+f x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.16, size = 44, normalized size = 0.77
method | result | size |
derivativedivides | \(\frac {c \left (-B \ln \left (-i+\tan \left (f x +e \right )\right )-\frac {-i B -A}{-i+\tan \left (f x +e \right )}\right )}{f a}\) | \(44\) |
default | \(\frac {c \left (-B \ln \left (-i+\tan \left (f x +e \right )\right )-\frac {-i B -A}{-i+\tan \left (f x +e \right )}\right )}{f a}\) | \(44\) |
risch | \(-\frac {c \,{\mathrm e}^{-2 i \left (f x +e \right )} B}{2 a f}+\frac {i c \,{\mathrm e}^{-2 i \left (f x +e \right )} A}{2 a f}-\frac {2 i B c x}{a}-\frac {2 i B c e}{a f}+\frac {B c \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}{a f}\) | \(83\) |
norman | \(\frac {\frac {\left (i B c +A c \right ) \tan \left (f x +e \right )}{a f}-\frac {-i A c +B c}{a f}-\frac {i B c x}{a}-\frac {i c B x \left (\tan ^{2}\left (f x +e \right )\right )}{a}}{1+\tan ^{2}\left (f x +e \right )}-\frac {B c \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 a f}\) | \(102\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.35, size = 71, normalized size = 1.25 \begin {gather*} \frac {{\left (-4 i \, B c f x e^{\left (2 i \, f x + 2 i \, e\right )} + 2 \, B c e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + {\left (i \, A - B\right )} c\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{2 \, a f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.19, size = 112, normalized size = 1.96 \begin {gather*} - \frac {2 i B c x}{a} + \frac {B c \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{a f} + \begin {cases} \frac {\left (i A c - B c\right ) e^{- 2 i e} e^{- 2 i f x}}{2 a f} & \text {for}\: a f e^{2 i e} \neq 0 \\x \left (\frac {2 i B c}{a} + \frac {\left (A c - 2 i B c e^{2 i e} + i B c\right ) e^{- 2 i e}}{a}\right ) & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 130 vs. \(2 (50) = 100\).
time = 0.56, size = 130, normalized size = 2.28 \begin {gather*} \frac {\frac {B c \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}{a} - \frac {2 \, B c \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - i\right )}{a} + \frac {B c \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1\right )}{a} + \frac {3 \, B c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 2 \, A c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 8 i \, B c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 3 \, B c}{a {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - i\right )}^{2}}}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.46, size = 54, normalized size = 0.95 \begin {gather*} \frac {-\frac {B\,c}{a}+\frac {A\,c\,1{}\mathrm {i}}{a}}{f\,\left (1+\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}-\frac {B\,c\,\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )}{a\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________